How to apply border inside a table ? – GeeksforGeeks
Posted by jpluimers on 2024/06/20
It is deprecated but still works and an easy way to quickly set the inner borders of an HTML table: use the rules attribute.
- [Wayback/Archive] How to apply border inside a table ? – GeeksforGeeks
Only Using HTML: In this case, we will use rules attribute of table. Rules is the attribute in HTML table which allows user to display only inside borders of the table which can be chosen among only rows, cols or all.
- [Wayback/Archive]
<table>: The Table element – HTML: HyperText Markup Language | MDN –rulesattribute
rulesDeprecatedThis enumerated attribute defines where rules, i.e. lines, should appear in a table. It can have the following values:
none, which indicates that no rules will be displayed; it is the default value;groups, which will cause the rules to be displayed between row groups (defined by the [Wayback/Archive]<thead>, [Wayback/Archive]<tbody>and [Wayback/Archive]<tfoot>elements) and between column groups (defined by the [Wayback/Archive]<col>and [Wayback/Archive]<colgroup>elements) only;rows, which will cause the rules to be displayed between rows;columns, which will cause the rules to be displayed between columns;all, which will cause the rules to be displayed between rows and columns.
To achieve a similar effect, apply the [Wayback/Archive]
borderproperty to the appropriate [Wayback/Archive]<thead>, [Wayback/Archive]<tbody>, [Wayback/Archive]<tfoot>, [Wayback/Archive]<col>, or [Wayback/Archive]<colgroup>elements.
I needed it for Inclusie/toegankelijkheid voor het @LUMC_Leiden: een tabel in HTML in plaats van plaatje zonder alt-text – #a11y.
Though rules is a deprecated feature, it still works and it is way easier than borders (which I described in HTML table border styles). The only drawback of rules is that they are inside the table, so if you want an outside border, then you need the more modern border styles.
Via: [Wayback/Archive] html table border inside – Recherche Google
–jeroen






Leave a comment