All Questions
Tagged with css html-table
7,373 questions
1
vote
1
answer
32
views
Select only the first match after each instance of another kind of match
I have a table that is broken up into groups headed by specially formatted elements. The first row of each group requires some special formatting so it is appropriately spaced and delimited from the ...
0
votes
2
answers
68
views
How to create a table with sticky column on left and right, and the body between them is scrollable?
I have been working on a piece of code, trying to achieve the desired layout for a table. However, every time I make adjustments to the code, it causes the table to become distorted or behave ...
2
votes
0
answers
49
views
Why does an <img> element inside an element with `display: table` expand in width when the image fails to load?
In the standard configuration of WordPress, when centering figure elements containing img elements is chosen, these elements are automatically styled with display: table; margin-left: auto; margin-...
1
vote
1
answer
90
views
How do I make two different table styles? [closed]
EDIT: I've updated this post with some of people's suggestions. I still can't get the coding to work right, though.
I'm trying to create a document with two distinct table styles (basically dialogue ...
1
vote
3
answers
103
views
Missing borders CSS /HTML
In my table I've implemented logic to highlight the Row/Column when the cell is selected but i don't seem to manage to get the borders on top and bottom of the column correct. The border on the bottom ...
0
votes
1
answer
59
views
textarea inside a `<td>` element is not responding to click events
I have a table with 6 columns. In one of the row cells I am using a textarea element to display and capture user input.
Currently, the content inside the text area is truncated and an ellipse is ...
1
vote
3
answers
57
views
How to make gradient column in a table?
I would like to have one column in a table have a blue gradient background from top to bottom. As in extending over multiple rows, ten precisely. Essentially like this one but for a column instead of ...
2
votes
2
answers
85
views
Discontinued border
I try to draw border-radius on certain rows.
The structure is as follow:
<tr>row with border-top-radius</tr>
<tr>normal row with some tds</tr>
<tr>normal row with some ...
-2
votes
1
answer
95
views
Counting cells with a specific class in JavaScript
I have a HTML table and the following script to add a specific class to the cells, depending on their content.
Now, I would like to count only the items with class = active and trigger a modal (...
0
votes
0
answers
52
views
How do I dynamically size HTML table column widths to the text in the "<th>" element?
I have a some data loaded into an HTML table. Each column of the table has a table header with text in it. I want each column to have a minimum width equal to length of that text (so that it doesn't ...
0
votes
2
answers
46
views
How can I make a table in HTML larger than the max-width of the page, and then have it be scrollable on the x-axis [duplicate]
I have been making a simple website for a video game that I play that details the characters and attacks that are in the game. This requires large tables to display the data that I want to show. For ...
0
votes
0
answers
43
views
Arrows are not working or showing for table content that is not displayed in the initial viewport
Some of the content career route connections do not work for the table's last row. So, I'm wondering that the information that we need to scroll to click on is experiencing arrow pathway connection ...
0
votes
0
answers
45
views
Correct way to set table dimensions when only providing <tr> height and colgroup
A html table can be sized by providing width and height, but it can also be sized by setting heights to its rows (<tr style='height: ...'>) and widths of its columns (via colgroup).
In the ...
-2
votes
1
answer
75
views
Making calculations in a HTML table
I have a created a HTML table which is editable.
The table contains some cells are predefined with the numbers 1-5, than there is section where the user can enter data and in the last column there ...
0
votes
1
answer
74
views
Wordpress Text in Table Doesn't Match Rest of Post
I am making a post template that includes a rather large and complicated table. When editing in the classic editor 'visual' mode, everything looks like it matches. However, when it is published, the ...
1
vote
1
answer
62
views
How to generate a table with cells merged in a column [duplicate]
This is the table I expect:
And I used this code, but did not get the expected result
<table border="1" align="center" cellpadding="10px">
<thead>
<tr>
<th>a&...
1
vote
2
answers
55
views
Html table with header colpans doesn't render as expected
I got this generated colspanish table scrolling inside a div on horizontal.
Where the Auto 2 aggregated header column gets properly sized while Auto 1 doesn't.
How do I force Auto 1 to look as Auto 2? ...
0
votes
0
answers
62
views
Vertical gaps between table cells and their contents [duplicate]
I have a tabular layout which contains graphical contents. I understand that using tables for layout is no longer a best practice, but I'm exploring this approach for educational purposes and to ...
0
votes
1
answer
85
views
How to make HTML table responsive?
Right now because my table has many columns, right side of table overflows outside of the screen. I want to make it responsive so that the table wraps itself below for more columns. I want the table ...
1
vote
0
answers
73
views
HTML tables arbitrarily breaking to new page in PDF report
I am using JSReport (template engine: handlebars.js, pdf recipe: chrome-pdf) to generate PDF reports from html/css and I have encountered some very strange behavior with tables breaking to a new page ...
0
votes
0
answers
16
views
Why aren't the background-color styles for my table working and what can I do to fix it? [duplicate]
My table's background color styles in my head aren't styling the table cells in the body.
Here is my code:
<html>
<head>
<style>
#11 { background-color: hsv(0,0,100); }
#12 { ...
0
votes
1
answer
86
views
Create a table with empty space at bottom
I want to create a table with min-height: 90vh, so it don't get smaller than that particular height but when I do that the columns height gets increased and occupy space as per table height and that's ...
0
votes
1
answer
53
views
How to make elements stick to different scrollable containers for different scroll directions?
I have a long and wide table inside a width: 100%; overflow-x: auto; container, and I'm trying to achieve the following at the same time:
make the header row stick to the viewport's top edge;
make ...
-1
votes
1
answer
36
views
HTML table row is taller than the height setting for row and tds [closed]
Sample page displaying issue: https://andy3k.com/index.htm
Sample page displaying desired outcome: https://andy3k.com/travel/japan2024/index.htm
CSS: https://www.andy3k.com/Andy3k.css
JavaScript file ...
4
votes
3
answers
111
views
Split headerless html table rows 50% left and 50% right
I have 20 rows like this in a standard html table (table>tbody>tr>td) without a header.
current situation
<table>
<tbody>
<tr>
<td>1</td>
...
1
vote
1
answer
103
views
position:sticky is not working on merged cell
I want to fix the first and second columns of a table in left when the table scrolls horizontally. I used position:sticky for column fixation and it works fine on normal columns. However, I have ...
0
votes
2
answers
67
views
td cell to appear directly below th cell
I have a table html like the following:
<table>
<tbody>
<tr>
<th>Header 1</th>
<td>Data 1</td>
<th>Header 2</th>
...
0
votes
1
answer
120
views
Unable to make a column sticky in a table
I have a table with overflow-x enabled due to its length. The data at the start of each row gets hidden when scrolling horizontally, so I want to make at least one starting column sticky. I've tried ...
0
votes
2
answers
69
views
Display a table inline with <p> text
I am trying to display a table inline within a p element. The result should look similar to this:
*-----------------*
Text before. | Cell 1 | Cell 2 | Text after.
*-----------...
0
votes
0
answers
44
views
Bootstrap DateTimePicker Not Displaying Correctly in Responsive Table with Overflow Handling
I'm trying to create a responsive table with Bootstrap that includes DateTimePicker widgets in some cells. The table should have horizontal scrolling when needed, but I'm struggling to get the ...
0
votes
3
answers
253
views
How do I make sure that my table headers aligns with my table data in a nested html table?
For context, I need a nested table to group table data (by pdo, program, location). The problem is my th does not aligned with my nested td when the columns are not fully expanded. I'm using Angular ...
0
votes
1
answer
34
views
How do I make column fill available space without table overflow?
I am trying to make a responsive table where:
Columns 1-3 and column 5 will always autosize to fit their content.
Column 4 will occupy all remaining horizontal space.
Column 4 will never wrap text (i....
0
votes
3
answers
155
views
Flexible width in HTML table
I would like my table to fulfill these properties:
The width of the table is 100% of the parent container.
All columns width are fit to the maximum column width.
The column flex-column takes the ...
1
vote
1
answer
38
views
Adding Border Styling to Table Row Headings and Colum Headings
I would greatly appreciate some help with this, if possible. I'm trying to add some global CSS styling to tables that are automatically generated by our company platform's HTML editor, but running ...
0
votes
1
answer
40
views
Make table row height adjust to textarea content
I have the following table with a textarea inside the td:
#myarea {
box-sizing: border-box;
border: none;
width: 100%;
height: 100%;
resize: none;
}
<table>
<...
1
vote
0
answers
46
views
HTML table header is not repeat on each while printing
When I set HTML table header height 200px (I think, this depends on browser, you can replicate this by keep increasing the height value), it's not repeated on every page while printing it. Same ...
0
votes
1
answer
90
views
Why does my table header take half the table height in Firefox?
I have a table in HTML:
<div style="height: 90vh">
<div style="position: relative; width: 100%; height: 100%">
<table style="height: 100%">
<thead>
<...
0
votes
2
answers
52
views
Use thinner borders within td elements inside a colspan th
I have the following HTML table. As you can see I have two columns that have a colspan attribute. I want the td's inside those to have thinner borders, so that users can more clearly see « real » ...
3
votes
1
answer
48
views
Which Methods/How to replicate this "Price Compare" responsive card layout?
plan comparison desktop:
plan comparison mobile:
Hi,
I am looking for some ideas on ways to design this section of the layout.
This section is both in desktop version and mobile (pictures above)
It ...
0
votes
1
answer
44
views
How to use page breaks when printing multiple rows of a table in HTML?
I have a table in HTML where users can add rows as much as they want. However, when the table is long and I print the form, the form is cut off, and the other rows are not visible. What I want to ...
-1
votes
2
answers
167
views
Possible causes for css sticky positioning in a <thead> to not work
I've created a custom element that mimics c#’s datagridview. I was able to make the <thead> stick at the top like dot net’s listview or datagridview header until just recently I noticed it doesn’...
2
votes
3
answers
99
views
HTML Table header border moving (overlapped by bg color)
I've created this dummy table based on my real project. The issue I'm having is that the border on the Table Header is moving when the content of the cells changing (no-wrap) hence the border ...
1
vote
2
answers
62
views
Apply CSS style depending of tbody height
I have simple example that applies style when div height is less than 400px.
<html>
<head>
<style>
.card-container {
container-type: size;
...
0
votes
1
answer
28
views
How to remove this unwanted table cell horizontal padding on Safari?
I'm using a table: https://codepen.io/Offirmo/full/rNgjdEb
Chrome and Firefox don't pad the cells horizontally
Safari does, making the table appear larger
I've googled it, added margin+padding: 0, ...
0
votes
2
answers
50
views
table th td must take max-width 200px then only it should wrap
.table_outer {
width: 500px;
overflow-x: auto; /* Allow horizontal scrolling */
}
table {
width: 100%;
min-width: max-content; /* Ensure table doesn't shrink below content width */
table-...
0
votes
1
answer
45
views
Two different tables with the same col-spans
I'm trying to align the columns of two different tables that carry the same model of information, but not the same items.
This leads to columns of both tables being of different sizes, which makes ...
3
votes
0
answers
82
views
CSS to highlight "nested" rows using th and varied rowspan attributes using the :has selector
I have been playing around with the :has selector to see if I am able to create a pure-css solution for highlighting rows in "tree" views using HTML table. I've seen solutions using <...
0
votes
1
answer
32
views
When mouseover on a table cell I want add a border to the cell to highlight it. But when I do this all the other cells width and height are effected
I have following html code for a simple intro page. On mousever (hover) event I will add a border to highlicght the cell. But when I do it with my existing code and css, all the cell heights and ...
1
vote
2
answers
85
views
How to remove space above the first html table row when using border-collapse: separate?
I am using border-collapse: separate property to add spacing between table rows, and I would like to remove the spacing above the very first table row. What's the best way to do that?
This is what my ...
0
votes
1
answer
42
views
Nested CSS Grid overflows horizontally when placed inside HTML table element
I have a css grid in invoice generated dynamically. I know the number of rows and column in advance. I'm also using template rows and template columns and defining column width for each column ...