You need to apply border to cells (TD) instead of table
TD,TH {
border:1px solid black;
}
<!doctype html>
<html>
<body style="font-family:Arial;">
<table style="font-family:Arial; font-size:12px;">
<tr>
<th align="left">Initiative</th>
<th align="left">Scheduled Finish</th>
</tr>
<tr>
<td align="left">[Initiative Name]</td>
<td align="left">[Initiative Scheduled Finish Date]</td>
</tr>
</table>
</body>
</html>
Answer from Iลya Bursov on Stack OverflowW3Schools
w3schools.com โบ html โบ html_table_borders.asp
HTML Table Borders
Skip the border around the table by leaving out table from the css selector: th, td { border: 1px solid black; border-radius: 10px; } Try it Yourself ยป ยท With the border-style property, you can set the appearance of the border.
W3C
w3.org โบ Style โบ Tables โบ examples.html
Examples of table borders and rules
Assuming that `thin' means 1px (not too unlikely), the table's border will be 2px shadow + 1px padding + 1px margin + 1 px shadow = 5px.
Border around the table and not around the rows - HTML & CSS - SitePoint Forums | Web Development & Design Community
Whilst code would still validate, you shouldnโt really have any styling markup on a table as this can be achieved through CSS. Whether this be padding, margin or borders, remove all styling information from a table and code a table in itโs purest form as my example above and then simply style ... More on sitepoint.com
html - How to border every cell in a table? - Stack Overflow
I have a simple table. I want a 1px solid black border around every cell. For some reason I am only getting a border outlining the entire table. I tried adding border-collapse: separate; to the table style, which I thought was the default, but that didn't work either. More on stackoverflow.com
tables - Tabular border style - TeX - LaTeX Stack Exchange
How do I change the border style? Using | I can draw thin solid vertical lines and \hline draws thin solid horizontal lines. I would like a thick outer border and thin dotted lines of various sizes and colors in the table. In short I would like to achieve similar functionality of attached ... More on tex.stackexchange.com
[SOLVED] Html table border
The top of my html code is table style="border-color: #000000; width: 100%; margin-left: auto; margin-right: auto;" border="1" cellspacing="0" cellpadding="0" But the black border is not appearing on my tables. More on forum.ionicframework.com
Videos
15:17
HTML Tutorial #12 - HTML Table Borders | 2 Ways To Specify HTML ...
10:09
Format a table in Microsoft Word (borders, shading and pre-set ...
01:22
How To Change Table Border Style In Word - YouTube
08:41
CSS Table Border Tutorial - Better Than HTML Table Borders - YouTube
08:10
HTML and CSS Tutorial Series Part 6 Style Table Borders - YouTube
11:53
๐ฅ How to Design a Stunning Table Using CSS (Step-by-Step Tutorial!)
Engineering LibreTexts
eng.libretexts.org โบ campus bookshelves โบ delta college โบ web site design โบ 9: using tables
9.2: Table Borders - Engineering LibreTexts
April 19, 2023 - Use the properties border-top, border-bottom, border-left, and border-right to selectively apply borders around the table. For example, the table in Figure \(\PageIndex{4}\) displays only top and bottom borders with the style sheet given in ...
SitePoint
sitepoint.com โบ html & css
Border around the table and not around the rows - HTML & CSS - SitePoint Forums | Web Development & Design Community
November 8, 2006 - Also, Tyssenโs advice will be applicable if you decide that you want borders on your trโs or tdโs as there will be a margin between the cells by default unless you collapse them. ... I agreed with AutisticCuckoo This is the correct answer. ... But, Apparently the cell lines were still there so the only way I thought this could happen was if the table already had a border=โ1โ thereโฆ
Top answer 1 of 3
3
You need to apply border to cells (TD) instead of table
TD,TH {
border:1px solid black;
}
<!doctype html>
<html>
<body style="font-family:Arial;">
<table style="font-family:Arial; font-size:12px;">
<tr>
<th align="left">Initiative</th>
<th align="left">Scheduled Finish</th>
</tr>
<tr>
<td align="left">[Initiative Name]</td>
<td align="left">[Initiative Scheduled Finish Date]</td>
</tr>
</table>
</body>
</html>
2 of 3
2
Safest way is giving your table a class. This way it won't affect any other tables in your page.
.my-table-border th,
.my-table-border td {
border: 1px solid black
}
<!doctype html>
<html>
<body style="font-family:Arial;">
<table class="my-table-border" style="font-family:Arial; font-size:12px; border:1px solid black;">
<tr style="outline: thin solid">
<th align="left">Initiative</th>
<th align="left">Scheduled Finish</th>
</tr>
<tr style="outline: thin solid">
<td align="left">[Initiative Name]</td>
<td align="left">[Initiative Scheduled Finish Date]</td>
</tr>
</table>
</body>
</html>
The table class is my-table-border and the selector is only picking tds and ths inside of tables that have this class.
Top answer 1 of 6
27
\documentclass{article}
\usepackage{array,booktabs,arydshln,xcolor}
\newcommand\VRule[1][\arrayrulewidth]{\vrule width #1}
\begin{document}
\begin{tabular}{!{\VRule[2pt]}c!{\VRule}c!{\color{red}\VRule[3pt]}c!{\VRule}}
Column 1 & Column 2 & column3 \\\specialrule{3pt}{0pt}{0pt}
second row & & \\\hdashline
third row & & \\\specialrule{4pt}{0pt}{0pt}
\end{tabular}
\end{document}
2 of 6
33
Here are a few table layouts, with my favourite one last.
\documentclass{article}
\usepackage{xcolor}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{p{6cm}p{6cm}}
\begin{tabular}{|c|c|c|}
\hline
Column 1 & Column 2 & Column 3 \\
\hline
second row & & \\
\hline
third row & & \\
\hline
\end{tabular}
&
\begin{tabular}{ccc}
Column 1 & Column 2 & Column 3 \\
\hline
second row & & \\
\hline
third row & & \\
\hline
\end{tabular}
\\[5em]
\begin{tabular}{|ccc|}
\hline
Column 1 & Column 2 & Column 3 \\
\hline
second row & & \\
third row & & \\
\hline
\end{tabular}
&
\begin{tabular}{|c|c|c|}
\hline
Column 1 & Column 2 & Column 3 \\
\hline
second row & & \\
third row & & \\
\hline
\end{tabular}
\\[5em]
\begin{tabular}{ccc}
Column 1 & Column 2 & Column 3 \\
second row & & \\
third row & &
\end{tabular}
&
\begin{tabular}{lll}
\toprule
Column 1 & Column 2 & Column 3 \\
\midrule
second row & & \\
third row & & \\
\bottomrule
\end{tabular}
\\[5em]
% Colour for the rulings in tables:
\makeatletter
\def\rulecolor#1#{\CT@arc{#1}}
\def\CT@arc#1#2{%
\ifdim\baselineskip=\z@\noalign\fi
{\gdef\CT@arc@{\color#1{#2}}}}
\let\CT@arc@\relax
\rulecolor{gray!50}
\makeatother
\begin{tabular}{@{}lll@{}}
\toprule
Column 1 & Column 2 & Column 3 \\
\midrule
second row & & \\
third row & & \\
\bottomrule
\end{tabular}
&
\begin{tabular}{@{}lll@{}}
\toprule
Column 1 & Column 2 & Column 3 \\
\cmidrule(r){1-1}\cmidrule(lr){2-2}\cmidrule(l){3-3}
second row & & \\
third row & & \\
\bottomrule
\end{tabular}
\end{tabular}
\end{document}
APA Style
apastyle.apa.org โบ style-grammar-guidelines โบ tables-figures โบ tables
Table setup - APA Style
Tables and figures enable writers to present a large amount of information efficiently and to make their data more comprehensible. APA Style guidelines for tables and figures help ensure that visual displays are formatted clearly and consistently, thus contributing to the goal of effective ...
Hyperskill
hyperskill.org โบ university โบ frontend โบ html-table-borders
HTML Table Borders
October 2, 2024 - To specify the width of the table borders, use the CSS border-width property. This property allows you to set the thickness of the borders. The border-style property controls the style of the table borders.
Scaler
scaler.com โบ topics โบ table-border-in-html
HTML Table Borders - Scaler Topics
January 8, 2024 - Here in the above example, the CSS style within the <style> tag ensures that the borders collapse into a single border. For a smooth look, we can set the background color of each cell and match the border color with the document background color. This will create the illusion of an invisible border: ... This HTML code creates a table with white borders and a collapsed appearance.
Quackit
quackit.com โบ html โบ codes โบ tables โบ html_table_border.cfm
HTML Table Border
If you don't want the border to go all around the table (or if you want a different border on each side of the table), you can use any of the following properties: border-top, border-right, border-bottom, and border-left.
EITCA
eitca.org โบ home โบ how can you add borders to a table using css?
How can you add borders to a table using CSS? - EITCA Academy
August 7, 2023 - To add borders to a table using CSS, you can use the "border" property to apply borders to the entire table, and the "border-style", "border-width", and "border-color" properties to customize the border styles, widths, and colors.
W3Schools
w3schools.com โบ css โบ css_table.asp
CSS Styling Tables
The CSS border property is used to specify the width, style, and color of table borders.
Microsoft Support
support.microsoft.com โบ en-us โบ office โบ change-the-look-of-a-table-a18cbaa8-e681-455f-a99f-a2378fe5ff06
Change the look of a table - Microsoft Support
Use Pen Style to change the line style of the border. To apply the color, weight, or line style that you chose in step 2, do one of the following: ... Select Table Design > Borders, then select the border option that you want to apply.
Screenstepslive
utah.screenstepslive.com โบ a โบ 1864861-table-borders-and-shading
Table Borders and Shading | Advanced HTML Elements | University of Utah
<table style="border: 1px solid; max-width: 100%; min-width: 40%; margin: 1.5rem auto; float: left;"> <caption>Table with Shaded Row</caption> <colgroup> <col style="border: 1px solid;" /> <col style="border: 1px solid;" /> <col style="border: 1px solid;" /> </colgroup> <thead> <tr style="border: ...
HTML AM
html.am โบ html-codes โบ tables โบ table-border.cfm
Table Border
If you want to change the way your table border looks, you can use CSS. CSS allows you to change the color, width, and style of your table borders.