Table cell borders with multiple thicknesses (or div borders)?


Andrew Truckle

I know how to style the border to double on a table cell or div border .

But how to do it (taken from Microsoft Word):

Extract from Microsoft Word

It has thick and thin borders. Can we do this easily using HTML/CSS?

Thank you.

renew:

Here is some sample HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<meta content="en-gb" http-equiv="Content-Language">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Untitled 1</title>
</head>

<body>

<div style="border-bottom:1px black double">
    SAMPLE TEXT</div>

</body>

</html>

It will generate a double line, but both lines are the same thickness .

In the Microsoft Word example, it has two lines, but one of them is thicker. Look? Can we use CSS/HTML?

amber

If you want to create something like a double line in the image, you can create an additional container around the text:

<div class="outer">
  <span class="inner">
    Text
  </span>
</div>

Then you can style those lines like this:

.outer {
  border-bottom: 1px solid #000;
  padding-bottom: 2px;
}
.inner {
  border-bottom: 4px solid #000;
}

Related


Table cell borders with multiple thicknesses (or div borders)?

Andrew Truckle I know how to style the border to double on a table cell or div border . But how to do it (taken from Microsoft Word): It has thick and thin borders. Can we do this easily using HTML/CSS? Thank you. renew: Here is some sample HTML: <!DOCTYPE htm

There are table borders, but no cell borders

nickel The table I want to render has borders on the outside, but no borders on the inside. I know that I can PDFPCell.setBorderuse to disable borders for all cells in the table, but I also want to use borders outside the entire table. Is it possible to do thi

Unwanted table cell borders

pain table { border: solid 1px #eee; text-align: right; } tr, td, th { padding: 0; margin: 0; border: none; } th, td { width: 90px; height: 24px; line-height: 24px; padding: 0; } th { background-color: #f4f4f4; } .first-col { text-align:

Table with gradient borders and cell gradient borders

Ruslan López I would like to get a table with gradient effect on both border and div border, because they are one piece, that is, the border color of the cells should be different. So far this is what I get: table tr:first-child td { border-top: 0; } table t

Table with gradient borders and cell gradient borders

Ruslan López I want to get a table that has a gradient on both the border and the div border, because they are one piece, that is, the border color of the cells should be different. So far this is what I get: table tr:first-child td { border-top: 0; } table

Table with gradient borders and cell gradient borders

Ruslan López I want to get a table that has a gradient on both the border and the div border, because they are one piece, that is, the border color of the cells should be different. So far this is what I get: table tr:first-child td { border-top: 0; } table

How to make table cell borders cover neighbor table cell borders

L. So in the example below you will see that the black border only covers the bottom and right side, while I want it to cover the left and top as well. Is there a way to fix this? table { border-collapse: collapse; } table td { border: 1px solid red; he

How to make table cell borders cover neighbor table cell borders

L. So in the example below you will see that the black border only covers the bottom and right side, while I want it to cover the left and top as well. Is there a way to fix this? table { border-collapse: collapse; } table td { border: 1px solid red; he

borders around each cell and table

Swati My task is to maintain other people's code. In this fiddle I capture a snippet of an html file from this codebase https://jsfiddle.net/hqkw4x1s/ .lab { HEIGHT: 18px; FONT-WEIGHT: normal; TEXT-ALIGN: left; PADDING-LEFT: 4px; PADDING-RIGHT: 3px; BACKGROU

How to remove cell borders of a table?

gap How to remove the border of the first cell from a table via JavaScript? (eventually, as shown) var firstRow = document.getElementById("tbl1").rows[0].cells; //Get first cell //firstRow[0].style.REMOVE CELL BORDER //Get 2nd row of tbl1 var secRow = document

Table cell borders not using bootstrap to

definitely I am using Bootstrap "table-bordered" class to style my table. Below is my table <table class="table table-bordered"> <tr> <td>column1head</td> <td>column2head</td> <td>column3head</td> <td>co

Hide cell borders in HTML table

Nguyenbkcse I want to remove cell borders from HTML tables, but keep the "outer" borders. Such a default HTML table would be created as follows: But I want a layout like this: How can I do this? Azeez Kallayi You can do it with CSS. Please see the code below <

How to remove cell borders of a table?

gap How to remove the border of the first cell from a table via JavaScript? (eventually, as shown) var firstRow = document.getElementById("tbl1").rows[0].cells; //Get first cell //firstRow[0].style.REMOVE CELL BORDER //Get 2nd row of tbl1 var secRow = document

Hide cell borders in HTML table

Nguyenbkcse I want to remove cell borders from HTML tables, but keep the "outer" borders. Such a default HTML table would be created as follows: But I want a layout like this: How can I do this? Azeez Kallayi You can do it with CSS. Please see the code below <

Create borders for multiple cells in a table

user 9975 I use the following code and want to create borders for highlighted cells every time HTML code: <table id="table-1"> <thead> <tr> <th></th> <th>Col1</th> <th>Col2</th> <th>Col3</th> <th>Col4</th> <t

Create borders for multiple cells in a table

user 9975 I use the following code and want to create borders for highlighted cells every time HTML code: <table id="table-1"> <thead> <tr> <th></th> <th>Col1</th> <th>Col2</th> <th>Col3</th> <th>Col4</th> <t

Make table cell borders 100% of table width

discount I have the following markup: <div class="table"> <div class="row"> <div class="cell">1</div> <div class="cell">2</div> </div> <div class="row"> <div class="cell">3</div> <div class="cell">4</div> </div> <div class="row">

Make table cell borders 100% of table width

discount I have the following markup: <div class="table"> <div class="row"> <div class="cell">1</div> <div class="cell">2</div> </div> <div class="row"> <div class="cell">3</div> <div class="cell">4</div> </div> <div class="row">

Make table cell borders 100% of table width

discount I have the following markup: <div class="table"> <div class="row"> <div class="cell">1</div> <div class="cell">2</div> </div> <div class="row"> <div class="cell">3</div> <div class="cell">4</div> </div> <div class="row">

Table cell borders not extending to row height

Spunog I am using display:table-cell to display the calendar display. When I have a day that contains a lot of text, the square is bigger than the rest of the squares in the row, but the other divs in the row don't expand their bounds to match the new height.

How to highlight table cell borders when empty?

username I am using AngularJS to create dynamic rows and columns. Then, when I want to highlight that there is no data in any of the cells, I click the save button. So here's a JSFiddle of my demo : http://jsfiddle.net/jyshdf85/ My table code is as follows: <t

How to adjust the style of table cell borders?

Tobias Cuomo When I add a cell to the table, I can manipulate its thickness (borderBottomSize), its color (borderBottomColor) but not its style (dashed, dashed, long dashed...). When I read the code, PhpOffice\PhpWord\Style\Cell extends PhpOffice\PhpWord\Style

Table cell borders not extending to row height

Spunog I am using display:table-cell to display the calendar display. When I have a day that contains a lot of text, the square is bigger than the rest of the squares in the row, but the other divs in the row don't expand their bounds to match the new height.

Table cell borders not extending to row height

Spunog I am using display:table-cell to display the calendar display. When I have a day that contains a lot of text, the square is bigger than the rest of the squares in the row, but the other divs in the row don't expand their bounds to match the new height.

Table cell borders not extending to row height

Spunog I am using display:table-cell to display the calendar display. When I have a day that contains a lot of text, the square is bigger than the rest of the squares in the row, but the other divs in the row don't expand their bounds to match the new height.

Table cell borders not extending to row height

Spunog I am using display:table-cell to display the calendar display. When I have a day that contains a lot of text, the square is bigger than the rest of the squares in the row, but the other divs in the row don't expand their bounds to match the new height.

Table cell borders not extending to row height

Spunog I am using display:table-cell to display the calendar display. When I have a day that contains a lot of text, the square is bigger than the rest of the squares in the row, but the other divs in the row don't expand their bounds to match the new height.

Cannot display table and cell borders when printing

raghav710 I have a dynamically generated table in an asp.net view , i have printed another table with the same code and it prints .. rows and all.. but when i try to print that table i only get the text , there is no html my code here. (I don't have the reputa

How to align rectangle shapes with table cell borders?

crazy I have a Microsoft® Word 2016 MSO (16.0.8528.2126) 64-bit document that partially looks like this: Specifically, it's a table containing shapes (squares, to be specific). Designed for manual filling; the user should check the appropriate box under certai