How to apply wrap text style in JSF datatable?
I have a data table in my application, I fix the columns width
as 200
. If i print small line in datatable
column
means it prints correct format. If i print lengthy line in the datatable
column means, it cant wrap it out. how can i wrap
the text
in data table column.
Problem Description
jsf datatable
add a comment |
I have a data table in my application, I fix the columns width
as 200
. If i print small line in datatable
column
means it prints correct format. If i print lengthy line in the datatable
column means, it cant wrap it out. how can i wrap
the text
in data table column.
Problem Description
jsf datatable
@alexander: has nothing to do with jsf either then, and nothing with a datatable, all just 'table' then... so html and css. Why not added these tags. And the answer is explicitly about PrimeFaces, so the question was about a PrimeFaces datatable... imo bad editing of tags
– Kukeltje
Nov 25 '15 at 10:23
add a comment |
I have a data table in my application, I fix the columns width
as 200
. If i print small line in datatable
column
means it prints correct format. If i print lengthy line in the datatable
column means, it cant wrap it out. how can i wrap
the text
in data table column.
Problem Description
jsf datatable
I have a data table in my application, I fix the columns width
as 200
. If i print small line in datatable
column
means it prints correct format. If i print lengthy line in the datatable
column means, it cant wrap it out. how can i wrap
the text
in data table column.
Problem Description
jsf datatable
jsf datatable
edited Nov 25 '15 at 10:06
alexander
62111228
62111228
asked Dec 10 '13 at 12:01
PS KumarPS Kumar
49431434
49431434
@alexander: has nothing to do with jsf either then, and nothing with a datatable, all just 'table' then... so html and css. Why not added these tags. And the answer is explicitly about PrimeFaces, so the question was about a PrimeFaces datatable... imo bad editing of tags
– Kukeltje
Nov 25 '15 at 10:23
add a comment |
@alexander: has nothing to do with jsf either then, and nothing with a datatable, all just 'table' then... so html and css. Why not added these tags. And the answer is explicitly about PrimeFaces, so the question was about a PrimeFaces datatable... imo bad editing of tags
– Kukeltje
Nov 25 '15 at 10:23
@alexander: has nothing to do with jsf either then, and nothing with a datatable, all just 'table' then... so html and css. Why not added these tags. And the answer is explicitly about PrimeFaces, so the question was about a PrimeFaces datatable... imo bad editing of tags
– Kukeltje
Nov 25 '15 at 10:23
@alexander: has nothing to do with jsf either then, and nothing with a datatable, all just 'table' then... so html and css. Why not added these tags. And the answer is explicitly about PrimeFaces, so the question was about a PrimeFaces datatable... imo bad editing of tags
– Kukeltje
Nov 25 '15 at 10:23
add a comment |
3 Answers
3
active
oldest
votes
You can control word wrapping by CSS word-wrap
property. Inside tables, this only requires the table-layout
property to be set to fixed
, so that columns with a fixed width don't auto-expand when their content is larger.
E.g.
.fixed-size {
table-layout: fixed;
word-wrap: break-word;
}
and
<p:dataTable ... styleClass="fixed-size">
1
@BalusC...its working.Thank u for u r suggestion..
– PS Kumar
Dec 10 '13 at 12:50
@BalusC, is there a way not to brake a word while wrapping ?
– SergeiK
Sep 6 '17 at 12:30
add a comment |
The below worked for me in Chrome not in IE
.preformatted {
white-space: pre-wrap;
word-break: break-all;
}
<p:column>
<h:outputText value="#{bean.txt}" styleClass="preformatted" />
</p:column>
if the above style is applied in column level i.e., '<p:column styleClass="preformatted">' then it works fine in both IE and Chrome
– Teela
Feb 3 '17 at 10:10
add a comment |
My sollution is to apply word-break style to column. Just like:
<p:column id="accountsMaskColumn"
headerText="#{msg['mr.settings.headers.accountMask']}"
filterBy="#{item.accountMask}"
sortBy="#{item.accountMask}"
style="word-break: break-word">
<h:outputText value="#{item.accountMask}"/>
</p:column>
Hope someone find this useful
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%2f20493979%2fhow-to-apply-wrap-text-style-in-jsf-datatable%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can control word wrapping by CSS word-wrap
property. Inside tables, this only requires the table-layout
property to be set to fixed
, so that columns with a fixed width don't auto-expand when their content is larger.
E.g.
.fixed-size {
table-layout: fixed;
word-wrap: break-word;
}
and
<p:dataTable ... styleClass="fixed-size">
1
@BalusC...its working.Thank u for u r suggestion..
– PS Kumar
Dec 10 '13 at 12:50
@BalusC, is there a way not to brake a word while wrapping ?
– SergeiK
Sep 6 '17 at 12:30
add a comment |
You can control word wrapping by CSS word-wrap
property. Inside tables, this only requires the table-layout
property to be set to fixed
, so that columns with a fixed width don't auto-expand when their content is larger.
E.g.
.fixed-size {
table-layout: fixed;
word-wrap: break-word;
}
and
<p:dataTable ... styleClass="fixed-size">
1
@BalusC...its working.Thank u for u r suggestion..
– PS Kumar
Dec 10 '13 at 12:50
@BalusC, is there a way not to brake a word while wrapping ?
– SergeiK
Sep 6 '17 at 12:30
add a comment |
You can control word wrapping by CSS word-wrap
property. Inside tables, this only requires the table-layout
property to be set to fixed
, so that columns with a fixed width don't auto-expand when their content is larger.
E.g.
.fixed-size {
table-layout: fixed;
word-wrap: break-word;
}
and
<p:dataTable ... styleClass="fixed-size">
You can control word wrapping by CSS word-wrap
property. Inside tables, this only requires the table-layout
property to be set to fixed
, so that columns with a fixed width don't auto-expand when their content is larger.
E.g.
.fixed-size {
table-layout: fixed;
word-wrap: break-word;
}
and
<p:dataTable ... styleClass="fixed-size">
answered Dec 10 '13 at 12:18
BalusCBalusC
848k29831503221
848k29831503221
1
@BalusC...its working.Thank u for u r suggestion..
– PS Kumar
Dec 10 '13 at 12:50
@BalusC, is there a way not to brake a word while wrapping ?
– SergeiK
Sep 6 '17 at 12:30
add a comment |
1
@BalusC...its working.Thank u for u r suggestion..
– PS Kumar
Dec 10 '13 at 12:50
@BalusC, is there a way not to brake a word while wrapping ?
– SergeiK
Sep 6 '17 at 12:30
1
1
@BalusC...its working.Thank u for u r suggestion..
– PS Kumar
Dec 10 '13 at 12:50
@BalusC...its working.Thank u for u r suggestion..
– PS Kumar
Dec 10 '13 at 12:50
@BalusC, is there a way not to brake a word while wrapping ?
– SergeiK
Sep 6 '17 at 12:30
@BalusC, is there a way not to brake a word while wrapping ?
– SergeiK
Sep 6 '17 at 12:30
add a comment |
The below worked for me in Chrome not in IE
.preformatted {
white-space: pre-wrap;
word-break: break-all;
}
<p:column>
<h:outputText value="#{bean.txt}" styleClass="preformatted" />
</p:column>
if the above style is applied in column level i.e., '<p:column styleClass="preformatted">' then it works fine in both IE and Chrome
– Teela
Feb 3 '17 at 10:10
add a comment |
The below worked for me in Chrome not in IE
.preformatted {
white-space: pre-wrap;
word-break: break-all;
}
<p:column>
<h:outputText value="#{bean.txt}" styleClass="preformatted" />
</p:column>
if the above style is applied in column level i.e., '<p:column styleClass="preformatted">' then it works fine in both IE and Chrome
– Teela
Feb 3 '17 at 10:10
add a comment |
The below worked for me in Chrome not in IE
.preformatted {
white-space: pre-wrap;
word-break: break-all;
}
<p:column>
<h:outputText value="#{bean.txt}" styleClass="preformatted" />
</p:column>
The below worked for me in Chrome not in IE
.preformatted {
white-space: pre-wrap;
word-break: break-all;
}
<p:column>
<h:outputText value="#{bean.txt}" styleClass="preformatted" />
</p:column>
edited Feb 3 '17 at 9:56
answered Sep 14 '16 at 12:24
TeelaTeela
86127
86127
if the above style is applied in column level i.e., '<p:column styleClass="preformatted">' then it works fine in both IE and Chrome
– Teela
Feb 3 '17 at 10:10
add a comment |
if the above style is applied in column level i.e., '<p:column styleClass="preformatted">' then it works fine in both IE and Chrome
– Teela
Feb 3 '17 at 10:10
if the above style is applied in column level i.e., '<p:column styleClass="preformatted">' then it works fine in both IE and Chrome
– Teela
Feb 3 '17 at 10:10
if the above style is applied in column level i.e., '<p:column styleClass="preformatted">' then it works fine in both IE and Chrome
– Teela
Feb 3 '17 at 10:10
add a comment |
My sollution is to apply word-break style to column. Just like:
<p:column id="accountsMaskColumn"
headerText="#{msg['mr.settings.headers.accountMask']}"
filterBy="#{item.accountMask}"
sortBy="#{item.accountMask}"
style="word-break: break-word">
<h:outputText value="#{item.accountMask}"/>
</p:column>
Hope someone find this useful
add a comment |
My sollution is to apply word-break style to column. Just like:
<p:column id="accountsMaskColumn"
headerText="#{msg['mr.settings.headers.accountMask']}"
filterBy="#{item.accountMask}"
sortBy="#{item.accountMask}"
style="word-break: break-word">
<h:outputText value="#{item.accountMask}"/>
</p:column>
Hope someone find this useful
add a comment |
My sollution is to apply word-break style to column. Just like:
<p:column id="accountsMaskColumn"
headerText="#{msg['mr.settings.headers.accountMask']}"
filterBy="#{item.accountMask}"
sortBy="#{item.accountMask}"
style="word-break: break-word">
<h:outputText value="#{item.accountMask}"/>
</p:column>
Hope someone find this useful
My sollution is to apply word-break style to column. Just like:
<p:column id="accountsMaskColumn"
headerText="#{msg['mr.settings.headers.accountMask']}"
filterBy="#{item.accountMask}"
sortBy="#{item.accountMask}"
style="word-break: break-word">
<h:outputText value="#{item.accountMask}"/>
</p:column>
Hope someone find this useful
answered Nov 23 '18 at 7:01
BenderBender
146211
146211
add a comment |
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%2f20493979%2fhow-to-apply-wrap-text-style-in-jsf-datatable%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
@alexander: has nothing to do with jsf either then, and nothing with a datatable, all just 'table' then... so html and css. Why not added these tags. And the answer is explicitly about PrimeFaces, so the question was about a PrimeFaces datatable... imo bad editing of tags
– Kukeltje
Nov 25 '15 at 10:23