Skip to content

Commit 1df9111

Browse files
committed
Add in more classes (tables, lists)
1 parent 522593c commit 1df9111

4 files changed

Lines changed: 149 additions & 96 deletions

File tree

css/smpte.css

Lines changed: 68 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -293,78 +293,79 @@ tbody {
293293
text-align: left;
294294
}
295295

296-
td.center-cell {
297-
text-align: center;
298-
}
299-
300-
table.col-1-center tr td:nth-child(1) {
301-
text-align: center;
302-
}
303-
304-
table.col-2-center tr td:nth-child(2) {
305-
text-align: center;
306-
}
296+
/* cell alignment utilities */
307297

308-
table.col-3-center tr td:nth-child(3) {
309-
text-align: center;
310-
}
298+
td.center-cell { text-align: center; }
299+
td.right-cell { text-align: right; }
300+
td.left-cell { text-align: left; }
301+
td.top-cell { vertical-align: top; }
311302

312-
table.col-4-center tr td:nth-child(4) {
313-
text-align: center;
314-
}
303+
/* column alignment utilities */
315304

316-
table.col-5-center tr td:nth-child(5) {
317-
text-align: center;
318-
}
305+
/* center */
319306

320-
table.col-6-center tr td:nth-child(6) {
321-
text-align: center;
322-
}
323-
324-
table.col-7-center tr td:nth-child(7) {
325-
text-align: center;
326-
}
327-
328-
table.col-8-center tr td:nth-child(8) {
329-
text-align: center;
330-
}
331-
332-
/* column nowrap utilities */
307+
table.col-1-center tr td:nth-child(1), table.col-2-center tr td:nth-child(2),
308+
table.col-3-center tr td:nth-child(3), table.col-4-center tr td:nth-child(4),
309+
table.col-5-center tr td:nth-child(5), table.col-6-center tr td:nth-child(6),
310+
table.col-7-center tr td:nth-child(7), table.col-8-center tr td:nth-child(8) {
311+
text-align: center;
312+
}
333313

334-
table.col-1-nowrap tr td:nth-child(1), table.col-1-nowrap tr th:nth-child(1) {
335-
white-space: nowrap;
336-
}
314+
/* right */
337315

338-
table.col-2-nowrap tr td:nth-child(2), table.col-2-nowrap tr th:nth-child(2) {
339-
white-space: nowrap;
340-
}
316+
table.col-1-right tr td:nth-child(1), table.col-2-right tr td:nth-child(2),
317+
table.col-3-right tr td:nth-child(3), table.col-4-right tr td:nth-child(4),
318+
table.col-5-right tr td:nth-child(5), table.col-6-right tr td:nth-child(6),
319+
table.col-7-right tr td:nth-child(7), table.col-8-right tr td:nth-child(8) {
320+
text-align: right;
321+
}
341322

342-
table.col-3-nowrap tr td:nth-child(3), table.col-3-nowrap tr th:nth-child(3) {
343-
white-space: nowrap;
344-
}
323+
/* left */
345324

346-
table.col-4-nowrap tr td:nth-child(4), table.col-4-nowrap tr th:nth-child(4) {
347-
white-space: nowrap;
348-
}
325+
table.col-1-left tr td:nth-child(1), table.col-2-left tr td:nth-child(2),
326+
table.col-3-left tr td:nth-child(3), table.col-4-left tr td:nth-child(4),
327+
table.col-5-left tr td:nth-child(5), table.col-6-left tr td:nth-child(6),
328+
table.col-7-left tr td:nth-child(7), table.col-8-left tr td:nth-child(8) {
329+
text-align: left;
330+
}
349331

350-
table.col-5-nowrap tr td:nth-child(5), table.col-5-nowrap tr th:nth-child(5) {
351-
white-space: nowrap;
352-
}
332+
/* top */
353333

354-
table.col-6-nowrap tr td:nth-child(6), table.col-6-nowrap tr th:nth-child(6) {
355-
white-space: nowrap;
356-
}
334+
table.col-1-top tr td:nth-child(1), table.col-2-top tr td:nth-child(2),
335+
table.col-3-top tr td:nth-child(3), table.col-4-top tr td:nth-child(4),
336+
table.col-5-top tr td:nth-child(5), table.col-6-top tr td:nth-child(6),
337+
table.col-7-top tr td:nth-child(7), table.col-8-top tr td:nth-child(8) {
338+
vertical-align: top;
339+
}
357340

358-
table.col-7-nowrap tr td:nth-child(7), table.col-7-nowrap tr th:nth-child(7) {
359-
white-space: nowrap;
360-
}
341+
/* column nowrap utilities */
361342

362-
table.col-8-nowrap tr td:nth-child(8), table.col-8-nowrap tr th:nth-child(8) {
363-
white-space: nowrap;
364-
}
343+
table.col-1-nowrap tr td:nth-child(1), table.col-1-nowrap tr th:nth-child(1),
344+
table.col-2-nowrap tr td:nth-child(2), table.col-2-nowrap tr th:nth-child(2),
345+
table.col-3-nowrap tr td:nth-child(3), table.col-3-nowrap tr th:nth-child(3),
346+
table.col-4-nowrap tr td:nth-child(4), table.col-4-nowrap tr th:nth-child(4),
347+
table.col-5-nowrap tr td:nth-child(5), table.col-5-nowrap tr th:nth-child(5),
348+
table.col-6-nowrap tr td:nth-child(6), table.col-6-nowrap tr th:nth-child(6),
349+
table.col-7-nowrap tr td:nth-child(7), table.col-7-nowrap tr th:nth-child(7),
350+
table.col-8-nowrap tr td:nth-child(8), table.col-8-nowrap tr th:nth-child(8) {
351+
white-space: nowrap;
352+
}
365353

366354
/* column width utilities */
367355

356+
/* xsmall */
357+
358+
table.col-1-xsmall tr td:nth-child(1), table.col-1-xsmall tr th:nth-child(1),
359+
table.col-2-xsmall tr td:nth-child(2), table.col-2-xsmall tr th:nth-child(2),
360+
table.col-3-xsmall tr td:nth-child(3), table.col-3-xsmall tr th:nth-child(3),
361+
table.col-4-xsmall tr td:nth-child(4), table.col-4-xsmall tr th:nth-child(4),
362+
table.col-5-xsmall tr td:nth-child(5), table.col-5-xsmall tr th:nth-child(5),
363+
table.col-6-xsmall tr td:nth-child(6), table.col-6-xsmall tr th:nth-child(6),
364+
table.col-7-xsmall tr td:nth-child(7), table.col-7-xsmall tr th:nth-child(7),
365+
table.col-8-xsmall tr td:nth-child(8), table.col-8-xsmall tr th:nth-child(8) {
366+
width: 2rem;
367+
}
368+
368369
/* small */
369370

370371
table.col-1-small tr td:nth-child(1), table.col-1-small tr th:nth-child(1),
@@ -406,6 +407,10 @@ table.col-8-nowrap tr td:nth-child(8), table.col-8-nowrap tr th:nth-child(8) {
406407

407408
/* cell width utilities */
408409

410+
th.col-xsmall, td.col-xsmall {
411+
width: 2rem;
412+
}
413+
409414
th.col-small, td.col-small {
410415
width: 8rem;
411416
}
@@ -501,6 +506,12 @@ div.formula > .heading-label {
501506
break-before: page;
502507
}
503508

509+
/* list utilities */
510+
511+
ul.list-none {
512+
list-style-type: none;
513+
}
514+
504515
/* text utilities */
505516

506517
.text-nowrap,

doc/main.html

Lines changed: 64 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,27 +1360,38 @@ <h4>Using <code>class</code> attributes</h4>
13601360
<dt><code>example</code></dt>
13611361
<dd>Applied to <code>p</code> or <code>div</code> elements to create a formatted and automatically numbered example. See <a href="#sec-example-class"></a>.</dd>
13621362

1363-
<dt><code>center-cell</code></dt>
1364-
<dd>Applied to a <code>td</code> element to center-align the content of that individual table cell. See <a href="#sec-table-alignment-cell"></a>.</dd>
1363+
<dt><code>center-cell</code>;</dt>
1364+
<dt><code>right-cell</code>;</dt>
1365+
<dt><code>left-cell</code>;</dt>
1366+
<dt><code>top-cell</code></dt>
1367+
<dd>Applied to a <code>td</code> element to override the alignment of that individual table cell. See <a href="#sec-table-alignment-cell"></a>.</dd>
13651368

13661369
<dt><code>text-nowrap</code></dt>
13671370
<dd>Applied to an element to prevent line wrapping of its contents. This is commonly used on <code>th</code> or <code>td</code> elements to keep short identifiers, tags, or codes on a single line. See <a href="#sec-table-width-nowrap-cell"></a></dd>
13681371

13691372
<dt><code>col-1-nowrap</code> through <code>col-8-nowrap</code></dt>
13701373
<dd>Applied to a <code>table</code> element to prevent line wrapping within the specified column. See <a href="#sec-table-width-nowrap-column"></a></dd>
13711374

1375+
<dt><code>col-xsmall</code>;</dt>
13721376
<dt><code>col-small</code>;</dt>
13731377
<dt><code>col-medium</code>;</dt>
13741378
<dt><code>col-wide</code></dt>
1375-
<dd>Applied to <code>th</code> or <code>td</code> elements to suggest a relative column width for that cell. These classes provide narrow, medium, or wide column layouts without using inline <code>style</code> attributes. See <a href="#sec-table-width-nowrap-cell"></a></dd>
1379+
<dd>Applied to <code>th</code> or <code>td</code> elements to suggest a relative column width for that cell. These classes provide extra-narrow, narrow, medium, or wide column layouts without using inline <code>style</code> attributes. See <a href="#sec-table-width-nowrap-cell"></a></dd>
13761380

1381+
<dt><code>col-1-xsmall</code> through <code>col-8-xsmall</code>;</dt>
13771382
<dt><code>col-1-small</code> through <code>col-8-small</code>;</dt>
13781383
<dt><code>col-1-medium</code> through <code>col-8-medium</code>;</dt>
13791384
<dt><code>col-1-wide</code> through <code>col-8-wide</code></dt>
13801385
<dd>Applied to a <code>table</code> element to suggest relative widths for specific columns. See <a href="#sec-table-width-nowrap-column"></a></dd>
13811386

1382-
<dt><code>col-1-center</code> through <code>col-8-center</code></dt>
1383-
<dd>Applied to a <code>table</code> element to center-align the contents of the specified column. Multiple classes may be combined to center multiple columns. See <a href="#sec-table-alignment-column"></a>.</dd>
1387+
<dt><code>col-1-center</code> through <code>col-8-center</code>;</dt>
1388+
<dt><code>col-1-right</code> through <code>col-8-right</code>;</dt>
1389+
<dt><code>col-1-left</code> through <code>col-8-left</code>;</dt>
1390+
<dt><code>col-1-top</code> through <code>col-8-top</code></dt>
1391+
<dd>Applied to a <code>table</code> element to override the alignment of the specified column. Multiple classes may be combined to align multiple columns. See <a href="#sec-table-alignment-column"></a>.</dd>
1392+
1393+
<dt><code>list-none</code></dt>
1394+
<dd>Applied to a <code>ul</code> element to remove bullet markers. See <a href="#sec-list-none"></a>.</dd>
13841395

13851396
<dt><code>formula</code></dt>
13861397
<dd>Applied to a <code>div</code> element that contains a block <code>math</code> element to format and number displayed formulae. See <a href="#sec-formulae"></a></dd>
@@ -1724,43 +1735,43 @@ <h4>Default Alignment</h4>
17241735
<h4>Column Alignment</h4>
17251736

17261737
<p>
1727-
To change the alignment of an entire column, a class such as <code>col-3-center</code> may be added to the <code>table</code> denoting which column to center align, as the below example shows.
1738+
To change the alignment of an entire column, classes such as <code>col-3-center</code>, <code>col-3-right</code>, <code>col-3-left</code>, or <code>col-3-top</code> may be added to the <code>table</code> element. Multiple alignment classes may be combined across different columns, and multiple classes targeting the same column are also allowed since horizontal (<code>text-align</code>) and vertical (<code>vertical-align</code>) alignment are independent properties, as the below example shows.
17281739
</p>
17291740

17301741
<pre data-include="snippets/tab-sample-tabledata-colcenter.txt"></pre>
1731-
1742+
17321743
<p>is rendered as</p>
17331744

1734-
<table id="tab-sample-tabledata-colcenter" class="col-3-center">
1735-
<caption><code>col-x-center</code> Table Sample</caption>
1745+
<table id="tab-sample-tabledata-colcenter" class="col-1-top col-2-top col-2-right col-3-top col-3-center">
1746+
<caption><code>col-1-top col-2-top col-2-right col-3-top col-3-center</code> Table Sample</caption>
17361747
<thead>
17371748
<tr>
17381749
<th>Sample Number</th>
1739-
<th>Sample Name</th>
1750+
<th>Value</th>
17401751
<th>Sample Code</th>
17411752
</tr>
17421753
</thead>
17431754
<tbody>
17441755
<tr>
17451756
<td>0001</td>
1746-
<td>Name 01</td>
1757+
<td>42</td>
17471758
<td><code>Code 1</code></td>
17481759
</tr>
17491760
<tr>
17501761
<td>0002</td>
1751-
<td>Name 02</td>
1762+
<td>This is a longer description that spans multiple lines to demonstrate how <code>col-2-top</code> and <code>col-2-right</code> may be combined on the same column to independently control vertical and horizontal alignment.</td>
17521763
<td><code>Code 2</code></td>
17531764
</tr>
17541765
<tr>
17551766
<td>0003</td>
1756-
<td>Name 03</td>
1767+
<td>8</td>
17571768
<td><code>Code 3</code></td>
17581769
</tr>
17591770
</tbody>
17601771
</table>
17611772

17621773
<p class="note">
1763-
Classes are available to center align columns 1-8 (as <code>col-x-center</code>), and multiple classes to <code>table</code> may be added to align more columns as needed.
1774+
Alignment classes are available for columns 1–8 using <code>col-x-center</code>, <code>col-x-right</code>, <code>col-x-left</code>, and <code>col-x-top</code>. Multiple classes may be combined on the same <code>table</code> to align different columns independently.
17641775
</p>
17651776
<p class="note">
17661777
Tables over 8 columns wide should not be used and instead split into multiple smaller tables.
@@ -1771,15 +1782,15 @@ <h4>Column Alignment</h4>
17711782
<h4>Cell Alignment</h4>
17721783

17731784
<p>
1774-
To change the alignment of an individual cell, the class <code>center-cell</code> may be added to each <code>td</code> as needed, as the below example shows.
1785+
To change the alignment of an individual cell, classes such as <code>center-cell</code>, <code>right-cell</code>, <code>left-cell</code>, or <code>top-cell</code> may be added to each <code>td</code> as needed, as the below example shows.
17751786
</p>
17761787

17771788
<pre data-include="snippets/tab-sample-tabledata-centercell.txt"></pre>
1778-
1789+
17791790
<p>is rendered as</p>
17801791

17811792
<table id="tab-sample-tabledata-centercell">
1782-
<caption><code>center-cell</code> Table Sample</caption>
1793+
<caption>Cell Alignment Table Sample</caption>
17831794
<thead>
17841795
<tr>
17851796
<th>Sample Number</th>
@@ -1789,29 +1800,30 @@ <h4>Cell Alignment</h4>
17891800
</thead>
17901801
<tbody>
17911802
<tr>
1792-
<td>0001</td>
1803+
<td class="right-cell">0001</td>
17931804
<td>Name 01</td>
17941805
<td><code>Code 1</code></td>
17951806
</tr>
17961807
<tr>
1797-
<td class="center-cell">centered 0002</td>
1808+
<td class="center-cell">0002</td>
17981809
<td>Name 02</td>
17991810
<td><code>Code 2</code></td>
18001811
</tr>
18011812
<tr>
1802-
<td>0003</td>
1813+
<td class="top-cell">0003</td>
18031814
<td>Name 03</td>
18041815
<td><code>Code 3</code></td>
18051816
</tr>
1817+
<tr>
1818+
<td class="top-cell">0004</td>
1819+
<td class="top-cell">Name 04</td>
1820+
<td>This is a longer description that spans multiple lines to demonstrate how the <code>top-cell</code> class aligns the content of the first two cells to the top of the row rather than the default middle alignment when adjacent cells contain more content.</td>
1821+
</tr>
18061822
</tbody>
18071823
</table>
18081824

18091825
<p class="note">
1810-
The <code>center-cell</code> class may be added to as many <code>td</code> as needed.
1811-
</p>
1812-
1813-
<p>
1814-
Vertical cell alignment is not available at this time, and the default is set to top.
1826+
Cell alignment classes may be added to as many <code>td</code> elements as needed and may be combined with column-level alignment classes.
18151827
</p>
18161828
</section>
18171829
</section>
@@ -2097,7 +2109,7 @@ <h3>Column Width and No-wrap (Column-level)</h3>
20972109

20982110
<div class="example">
20992111
<pre>
2100-
&lt;table id="tab-sample-tabledata-widthcolumn" class="col-3-nowrap col-1-small col-4-wide"&gt;
2112+
&lt;table id="tab-sample-tabledata-widthcolumn" class="col-3-nowrap col-1-xsmall col-4-wide"&gt;
21012113
&lt;caption&gt;Column-level Width and No-wrap Table Sample&lt;/caption&gt;
21022114
&lt;thead&gt;
21032115
&lt;tr&gt;
@@ -2126,7 +2138,7 @@ <h3>Column Width and No-wrap (Column-level)</h3>
21262138

21272139
<p>is rendered as</p>
21282140

2129-
<table id="tab-sample-tabledata-widthcolumn" class="col-3-nowrap col-1-small col-4-wide">
2141+
<table id="tab-sample-tabledata-widthcolumn" class="col-3-nowrap col-1-xsmall col-4-wide">
21302142
<caption>Column-level Width and No-wrap Table Sample</caption>
21312143
<thead>
21322144
<tr>
@@ -2416,6 +2428,31 @@ <h3>Complex List Example</h3>
24162428
</div>
24172429

24182430
</section>
2431+
2432+
<section id="sec-list-none">
2433+
<h3>Unordered List Without Bullets</h3>
2434+
2435+
<p>
2436+
To remove bullet markers from an unordered list, the class <code>list-none</code> may be applied to the <code>ul</code> element, as the below example shows.
2437+
</p>
2438+
2439+
<div class="example">
2440+
<pre>
2441+
&lt;ul class="list-none"&gt;
2442+
&lt;li&gt;First list item&lt;/li&gt;
2443+
&lt;li&gt;Second list item&lt;/li&gt;
2444+
&lt;li&gt;Third list item&lt;/li&gt;
2445+
&lt;/ul&gt;</pre>
2446+
2447+
<p>is rendered as:</p>
2448+
<ul class="list-none">
2449+
<li>First list item</li>
2450+
<li>Second list item</li>
2451+
<li>Third list item</li>
2452+
</ul>
2453+
</div>
2454+
</section>
2455+
24192456
</section>
24202457
<section class="annex" id="sec-document-status-workflow">
24212458
<h2>Document Status Workflow</h2>

0 commit comments

Comments
 (0)