HTML bootstrap dl-horizontal not working as expected
Though i have div class "dl-horizontal" inside the table, the dl-horizontal fields appear to be outside the table
Code which i used:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span></caption>
<dl class="dl-horizontal">
<dt>field-1</dt><dd>14</dd>
<dt>field-2</dt><dd>13</dd>
<dt>field-3</dt><dd>12</dd>
</dl>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
</body>
</html>
What am i missing in this? I am trying to get "dl-horizontal" fields inside EVENT and above table values. any help is greatly appreciated. i tried table inside a the table but that doesnt seem to work.
html css bootstrap-4
add a comment |
Though i have div class "dl-horizontal" inside the table, the dl-horizontal fields appear to be outside the table
Code which i used:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span></caption>
<dl class="dl-horizontal">
<dt>field-1</dt><dd>14</dd>
<dt>field-2</dt><dd>13</dd>
<dt>field-3</dt><dd>12</dd>
</dl>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
</body>
</html>
What am i missing in this? I am trying to get "dl-horizontal" fields inside EVENT and above table values. any help is greatly appreciated. i tried table inside a the table but that doesnt seem to work.
html css bootstrap-4
<dl> tag is not a valid <table> tag, the only way to include it in table is to create a separate table row and data row in the table, for example: <table><tr><td colspan="6"><dl><dt></dt><dd></dd></dl></td></tr></table>
– Michał Dąbrowski
Nov 13 '18 at 23:39
add a comment |
Though i have div class "dl-horizontal" inside the table, the dl-horizontal fields appear to be outside the table
Code which i used:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span></caption>
<dl class="dl-horizontal">
<dt>field-1</dt><dd>14</dd>
<dt>field-2</dt><dd>13</dd>
<dt>field-3</dt><dd>12</dd>
</dl>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
</body>
</html>
What am i missing in this? I am trying to get "dl-horizontal" fields inside EVENT and above table values. any help is greatly appreciated. i tried table inside a the table but that doesnt seem to work.
html css bootstrap-4
Though i have div class "dl-horizontal" inside the table, the dl-horizontal fields appear to be outside the table
Code which i used:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span></caption>
<dl class="dl-horizontal">
<dt>field-1</dt><dd>14</dd>
<dt>field-2</dt><dd>13</dd>
<dt>field-3</dt><dd>12</dd>
</dl>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
</body>
</html>
What am i missing in this? I am trying to get "dl-horizontal" fields inside EVENT and above table values. any help is greatly appreciated. i tried table inside a the table but that doesnt seem to work.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span></caption>
<dl class="dl-horizontal">
<dt>field-1</dt><dd>14</dd>
<dt>field-2</dt><dd>13</dd>
<dt>field-3</dt><dd>12</dd>
</dl>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span></caption>
<dl class="dl-horizontal">
<dt>field-1</dt><dd>14</dd>
<dt>field-2</dt><dd>13</dd>
<dt>field-3</dt><dd>12</dd>
</dl>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
</body>
</html>
html css bootstrap-4
html css bootstrap-4
asked Nov 13 '18 at 23:23
user3357897user3357897
183
183
<dl> tag is not a valid <table> tag, the only way to include it in table is to create a separate table row and data row in the table, for example: <table><tr><td colspan="6"><dl><dt></dt><dd></dd></dl></td></tr></table>
– Michał Dąbrowski
Nov 13 '18 at 23:39
add a comment |
<dl> tag is not a valid <table> tag, the only way to include it in table is to create a separate table row and data row in the table, for example: <table><tr><td colspan="6"><dl><dt></dt><dd></dd></dl></td></tr></table>
– Michał Dąbrowski
Nov 13 '18 at 23:39
<dl> tag is not a valid <table> tag, the only way to include it in table is to create a separate table row and data row in the table, for example: <table><tr><td colspan="6"><dl><dt></dt><dd></dd></dl></td></tr></table>
– Michał Dąbrowski
Nov 13 '18 at 23:39
<dl> tag is not a valid <table> tag, the only way to include it in table is to create a separate table row and data row in the table, for example: <table><tr><td colspan="6"><dl><dt></dt><dd></dd></dl></td></tr></table>
– Michał Dąbrowski
Nov 13 '18 at 23:39
add a comment |
2 Answers
2
active
oldest
votes
This it the correct approach:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span></caption>
<tr><td colspan="6">
<dl class="dl-horizontal">
<dt>field-1</dt><dd>14</dd>
<dt>field-2</dt><dd>13</dd>
<dt>field-3</dt><dd>12</dd>
</dl>
</td></tr>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
</body>
</html>
add a comment |
I think that you need to place your description list with a table element for it to be included as part of the table. This snippet places it within the caption tag:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span>
<dl class="dl-horizontal">
<dt>field-1</dt>
<dd>14</dd>
<dt>field-2</dt>
<dd>13</dd>
<dt>field-3</dt>
<dd>12</dd>
</dl>
</caption>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
<hr>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span>
</caption>
<tr>
<td colspan="6">
<dl class="dl-horizontal">
<dt>field-1</dt>
<dd>14</dd>
<dt>field-2</dt>
<dd>13</dd>
<dt>field-3</dt>
<dd>12</dd>
</dl>
</td>
</tr>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
</body>
</html>
Thanks for the answer, but in this case, the description-list gets the caption properties(you can see a light gray for the description list). should i add seperate style properties for description list ?
– user3357897
Nov 13 '18 at 23:40
You will need to give it it's own styling. I've changed the snippet to show a seconds table where the list is placed with tr and td tags if you prefer that styling instead. But I'm guessing you'd want it something different.
– MichaelvE
Nov 13 '18 at 23:45
That should work for me. Thanks
– user3357897
Nov 13 '18 at 23:49
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53290958%2fhtml-bootstrap-dl-horizontal-not-working-as-expected%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
This it the correct approach:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span></caption>
<tr><td colspan="6">
<dl class="dl-horizontal">
<dt>field-1</dt><dd>14</dd>
<dt>field-2</dt><dd>13</dd>
<dt>field-3</dt><dd>12</dd>
</dl>
</td></tr>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
</body>
</html>
add a comment |
This it the correct approach:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span></caption>
<tr><td colspan="6">
<dl class="dl-horizontal">
<dt>field-1</dt><dd>14</dd>
<dt>field-2</dt><dd>13</dd>
<dt>field-3</dt><dd>12</dd>
</dl>
</td></tr>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
</body>
</html>
add a comment |
This it the correct approach:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span></caption>
<tr><td colspan="6">
<dl class="dl-horizontal">
<dt>field-1</dt><dd>14</dd>
<dt>field-2</dt><dd>13</dd>
<dt>field-3</dt><dd>12</dd>
</dl>
</td></tr>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
</body>
</html>
This it the correct approach:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span></caption>
<tr><td colspan="6">
<dl class="dl-horizontal">
<dt>field-1</dt><dd>14</dd>
<dt>field-2</dt><dd>13</dd>
<dt>field-3</dt><dd>12</dd>
</dl>
</td></tr>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span></caption>
<tr><td colspan="6">
<dl class="dl-horizontal">
<dt>field-1</dt><dd>14</dd>
<dt>field-2</dt><dd>13</dd>
<dt>field-3</dt><dd>12</dd>
</dl>
</td></tr>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span></caption>
<tr><td colspan="6">
<dl class="dl-horizontal">
<dt>field-1</dt><dd>14</dd>
<dt>field-2</dt><dd>13</dd>
<dt>field-3</dt><dd>12</dd>
</dl>
</td></tr>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
</body>
</html>
edited Nov 13 '18 at 23:50
answered Nov 13 '18 at 23:44
Michał DąbrowskiMichał Dąbrowski
865
865
add a comment |
add a comment |
I think that you need to place your description list with a table element for it to be included as part of the table. This snippet places it within the caption tag:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span>
<dl class="dl-horizontal">
<dt>field-1</dt>
<dd>14</dd>
<dt>field-2</dt>
<dd>13</dd>
<dt>field-3</dt>
<dd>12</dd>
</dl>
</caption>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
<hr>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span>
</caption>
<tr>
<td colspan="6">
<dl class="dl-horizontal">
<dt>field-1</dt>
<dd>14</dd>
<dt>field-2</dt>
<dd>13</dd>
<dt>field-3</dt>
<dd>12</dd>
</dl>
</td>
</tr>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
</body>
</html>
Thanks for the answer, but in this case, the description-list gets the caption properties(you can see a light gray for the description list). should i add seperate style properties for description list ?
– user3357897
Nov 13 '18 at 23:40
You will need to give it it's own styling. I've changed the snippet to show a seconds table where the list is placed with tr and td tags if you prefer that styling instead. But I'm guessing you'd want it something different.
– MichaelvE
Nov 13 '18 at 23:45
That should work for me. Thanks
– user3357897
Nov 13 '18 at 23:49
add a comment |
I think that you need to place your description list with a table element for it to be included as part of the table. This snippet places it within the caption tag:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span>
<dl class="dl-horizontal">
<dt>field-1</dt>
<dd>14</dd>
<dt>field-2</dt>
<dd>13</dd>
<dt>field-3</dt>
<dd>12</dd>
</dl>
</caption>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
<hr>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span>
</caption>
<tr>
<td colspan="6">
<dl class="dl-horizontal">
<dt>field-1</dt>
<dd>14</dd>
<dt>field-2</dt>
<dd>13</dd>
<dt>field-3</dt>
<dd>12</dd>
</dl>
</td>
</tr>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
</body>
</html>
Thanks for the answer, but in this case, the description-list gets the caption properties(you can see a light gray for the description list). should i add seperate style properties for description list ?
– user3357897
Nov 13 '18 at 23:40
You will need to give it it's own styling. I've changed the snippet to show a seconds table where the list is placed with tr and td tags if you prefer that styling instead. But I'm guessing you'd want it something different.
– MichaelvE
Nov 13 '18 at 23:45
That should work for me. Thanks
– user3357897
Nov 13 '18 at 23:49
add a comment |
I think that you need to place your description list with a table element for it to be included as part of the table. This snippet places it within the caption tag:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span>
<dl class="dl-horizontal">
<dt>field-1</dt>
<dd>14</dd>
<dt>field-2</dt>
<dd>13</dd>
<dt>field-3</dt>
<dd>12</dd>
</dl>
</caption>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
<hr>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span>
</caption>
<tr>
<td colspan="6">
<dl class="dl-horizontal">
<dt>field-1</dt>
<dd>14</dd>
<dt>field-2</dt>
<dd>13</dd>
<dt>field-3</dt>
<dd>12</dd>
</dl>
</td>
</tr>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
</body>
</html>
I think that you need to place your description list with a table element for it to be included as part of the table. This snippet places it within the caption tag:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span>
<dl class="dl-horizontal">
<dt>field-1</dt>
<dd>14</dd>
<dt>field-2</dt>
<dd>13</dd>
<dt>field-3</dt>
<dd>12</dd>
</dl>
</caption>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
<hr>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span>
</caption>
<tr>
<td colspan="6">
<dl class="dl-horizontal">
<dt>field-1</dt>
<dd>14</dd>
<dt>field-2</dt>
<dd>13</dd>
<dt>field-3</dt>
<dd>12</dd>
</dl>
</td>
</tr>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span>
<dl class="dl-horizontal">
<dt>field-1</dt>
<dd>14</dd>
<dt>field-2</dt>
<dd>13</dd>
<dt>field-3</dt>
<dd>12</dd>
</dl>
</caption>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
<hr>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span>
</caption>
<tr>
<td colspan="6">
<dl class="dl-horizontal">
<dt>field-1</dt>
<dd>14</dd>
<dt>field-2</dt>
<dd>13</dd>
<dt>field-3</dt>
<dd>12</dd>
</dl>
</td>
</tr>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span>
<dl class="dl-horizontal">
<dt>field-1</dt>
<dd>14</dd>
<dt>field-2</dt>
<dd>13</dd>
<dt>field-3</dt>
<dd>12</dd>
</dl>
</caption>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
<hr>
<table class="table table-condensed table-striped">
<caption>Event <span class="badge">2</span>
</caption>
<tr>
<td colspan="6">
<dl class="dl-horizontal">
<dt>field-1</dt>
<dd>14</dd>
<dt>field-2</dt>
<dd>13</dd>
<dt>field-3</dt>
<dd>12</dd>
</dl>
</td>
</tr>
<tr>
<th>Date</th>
<th>Field5</th>
<th>Field6</th>
<th>Field7</th>
<th>Field8</th>
<th>Field9</th>
</tr>
<tr>
<td class="text-nowrap">2018-11-13</td>
<td>val2</td>
<td>val2</td>
<td>val4</td>
<td>16</td>
<td>val5</td>
</tr>
</table>
</body>
</html>
edited Nov 13 '18 at 23:43
answered Nov 13 '18 at 23:37
MichaelvEMichaelvE
1,2631311
1,2631311
Thanks for the answer, but in this case, the description-list gets the caption properties(you can see a light gray for the description list). should i add seperate style properties for description list ?
– user3357897
Nov 13 '18 at 23:40
You will need to give it it's own styling. I've changed the snippet to show a seconds table where the list is placed with tr and td tags if you prefer that styling instead. But I'm guessing you'd want it something different.
– MichaelvE
Nov 13 '18 at 23:45
That should work for me. Thanks
– user3357897
Nov 13 '18 at 23:49
add a comment |
Thanks for the answer, but in this case, the description-list gets the caption properties(you can see a light gray for the description list). should i add seperate style properties for description list ?
– user3357897
Nov 13 '18 at 23:40
You will need to give it it's own styling. I've changed the snippet to show a seconds table where the list is placed with tr and td tags if you prefer that styling instead. But I'm guessing you'd want it something different.
– MichaelvE
Nov 13 '18 at 23:45
That should work for me. Thanks
– user3357897
Nov 13 '18 at 23:49
Thanks for the answer, but in this case, the description-list gets the caption properties(you can see a light gray for the description list). should i add seperate style properties for description list ?
– user3357897
Nov 13 '18 at 23:40
Thanks for the answer, but in this case, the description-list gets the caption properties(you can see a light gray for the description list). should i add seperate style properties for description list ?
– user3357897
Nov 13 '18 at 23:40
You will need to give it it's own styling. I've changed the snippet to show a seconds table where the list is placed with tr and td tags if you prefer that styling instead. But I'm guessing you'd want it something different.
– MichaelvE
Nov 13 '18 at 23:45
You will need to give it it's own styling. I've changed the snippet to show a seconds table where the list is placed with tr and td tags if you prefer that styling instead. But I'm guessing you'd want it something different.
– MichaelvE
Nov 13 '18 at 23:45
That should work for me. Thanks
– user3357897
Nov 13 '18 at 23:49
That should work for me. Thanks
– user3357897
Nov 13 '18 at 23:49
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53290958%2fhtml-bootstrap-dl-horizontal-not-working-as-expected%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
<dl> tag is not a valid <table> tag, the only way to include it in table is to create a separate table row and data row in the table, for example: <table><tr><td colspan="6"><dl><dt></dt><dd></dd></dl></td></tr></table>
– Michał Dąbrowski
Nov 13 '18 at 23:39