Comments (12)
Hi @numToStr, appreciate your words, thank you
It's an interesting case there's no such an option currently but I certainly can work on it.
PS: Just publish a option for disabling columns via attributes.
#[derive(Tabled)]
enum Letters {
Vowels {
character: char,
lang: u8,
},
Consonant(char),
#[header(hidden)]
Digit,
}
from tabled.
@zhiburt Thank you so much. v.0.1.3
does solve my use case.
Here is the final code
- Code
#[derive(Tabled)]
struct Detail(&'static str, String);
let details = [
Detail("Username", "username".to_string()),
Detail("Password", "password".to_string()),
Detail("URL", "url".to_string()),
Detail("Notes", "notes".to_string()),
];
let table = table!(
&details,
Disable::Row(..1),
Style::pseudo_clean().header(None),
HorizontalAlignment(Row(..), Alignment::Left),
Format(Row(..), |s| format!(" {} ", s))
);
print!("{}", table);
- Output
ββββββββββββ¬βββββββββββ
β Username β username β
β Password β password β
β URL β url β
β Notes β notes β
ββββββββββββ΄βββββββββββ
I'll now close the issue.
from tabled.
Woah, that's fast. Thanks for your hardwork.
So, is it published on crates?
from tabled.
So, is it published on crates?
Not yet, planning later this day as there's a couple more things to tackle.
from tabled.
Thanks for letting me know. Waiting for the next release βπ».
from tabled.
I've add a Dissable
setting which partially solves the problem.
According to a style I'll inspect some ways to bypass this and return with the answer.
Lines 60 to 93 in 08ee2ad
from tabled.
Just saw the test and I think Dissable::Row(..1)
solves the use case.
Off topic: Why did you name it Dissable
not Disable
?
from tabled.
Just saw the test and I think Dissable::Row(..1) solves the use case.
It is the only thing is a different look of a first row.
Off topic: Why did you name it Dissable not Disable?
Clearly misspell it π€ .
Already fixed. Good catch.
from tabled.
I've just published customization for Style
.
And getting back to your example now you can achieve it by combining custom styles + disable.
let table = table!(
&data,
HorizontalAlignment(Full, Alignment::Left),
Disable::Row(..1),
Style::pseudo_clean().header(None),
);
Output
ββββββββββ¬βββββββββ
βUsernameβusernameβ
βPasswordβpasswordβ
βURL βurl β
βNotes βnotes β
ββββββββββ΄βββββββββ
@numToStr please mark an issue as resolved if you think it is.
from tabled.
Thanks for the update. I'll try the new release and report back.
from tabled.
@zhiburt Did you publish the update?
from tabled.
@zhiburt Did you publish the update?
It's supposed to be in a few minutes
from tabled.
Related Issues (20)
- Unicode width not being accounted for HOT 2
- Can it be integrated with leptos? Can you give an example? HOT 4
- Add per column alignment setting for `ColumnNames`
- Typo in lib.rs line 72 - "almoust" should be "almost" HOT 1
- Is there any way to cut short long row entries HOT 3
- reduce padding option?
- Possible way to set intersection to a different character for just one row/column? HOT 3
- Make all set functions for `Style` `const` HOT 1
- `table.is_empty()` on tables with only a header row HOT 3
- Question: Is there a way to conditionally apply a cell background color? HOT 5
- Impossible to call `Style::empty().remove_left()` HOT 8
- `Rotate::Bottom` must reorder rows?
- Refactor `Builder` methods HOT 17
- Add a indent size
- Does not build on MacOS HOT 4
- Add a benchmark to compare against a basic tabulation HOT 1
- Why the left/right border does not have intersection `CompactTable`
- Impl `Dimension` for Vec<usize>
- Add a `skip` function to `CompactTable`
- Create a iterative interface to `CompactTable`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tabled.