Questions tagged [pre]
The <pre> element in HTML represents preformatted text. Text within this element is typically displayed in a non-proportional font exactly as it is laid out in the file. Whitespaces inside this element are displayed as typed. It is usually used for showing computer code or output.
384
questions
2
votes
0
answers
24
views
Pre tag with style="white-space: pre-line" removes leading spaces as desired, but how can I prevent it from losing internal spacing?
I'm having an issue with the HTML pre tag. If I do a very simple test it preserves spacing the way that I want it to. For instance, notice that there are two spaces in a row in certain parts of the ...
0
votes
1
answer
37
views
How to display HTML as code formatted for specific programming languages [closed]
I came across a website that displayed some SQL code. Inspecting the element, I saw that there was SQL specific classes and styles applied (ex. the table names were blue).
Here is what I saw:
My ...
0
votes
0
answers
53
views
I keep having the same error when trying to denoise an audio file using pywavelets and i'm not sure what to change
import numpy as np
import soundfile
from moviepy.editor import VideoFileClip
import pywt
def extract_audio(input_video_path, output_audio_path):
video_clip = VideoFileClip(input_video_path)
...
0
votes
1
answer
2k
views
Hydration completed but contains mismatches - Ascii art in a vue component
I have an ascii art that is displayed in the {{ name }} of the component. During development, I got a vue warn:
Hydration text content mismatch in <pre>
And an error:
Hydration completed but ...
0
votes
2
answers
135
views
word-break: break-all; CSS property not working for HTML <pre> tag? [duplicate]
I used the pre element to make my text appear as I typed it. But the text overflows past the container. So, I wanted to use the CSS word-break property to wrap the text, but it doesn't work.
pre {
...
1
vote
2
answers
306
views
How to make English text render right-to-left in mixed RTL <pre> tag?
I have the following code:
<html>
<head>
<style>
.rtl {
direction: rtl;
font-size: 16px;
font-family: Arial, Helvetica;
}
</style>
</head>
&...
0
votes
1
answer
88
views
How to ignore the n first tabulations in an XSLT template
The situation
In my XML files, I could have peace of code to show inside the tag <code>. But the indentation of my XML document is in conflict with the tabulation inside the <code> section....
0
votes
1
answer
37
views
<pre> within table cell ignores width constraints
I have the following HTML. This should display a table with a maximum width of 1024px in the middle of the screen. The table should contain two columns and two rows. The first column should have a ...
-1
votes
1
answer
864
views
How to insert a line break into a string variable to be displayed in a pre or code tag?
I know that there are lots of questions about line breaks in pre and code tags, but they all seem to concern string literals. However, I want to display a string variable that I get from a HTTP ...
0
votes
2
answers
81
views
Write webpage text in <code> or <pre> while keeping < and > tags in the text - (ie. "<mycustomtag>")
I have this C++ code (see my jsfiddle):
#include <ossource>
int main()
{
std::cout << "Hello World! \n";
return 0;
}
I am trying to include that in a code section on ...
0
votes
1
answer
168
views
Pre element formatting is off
I'm pretty new to html and css so forgive me if my question doesn't make 100% to any veterans. I am trying to apply a formatted line of code to a website using the element but it is using all of the ...
0
votes
2
answers
24
views
Shiny automatically scrolldown PRE element
This is my MWE:
library(shiny)
ui <- fluidPage(
uiOutput("log"),
actionButton("test","Click")
)
server <- function(input, output,session) {
RV<-...
0
votes
1
answer
106
views
Ignore tags in <pre>, but also ignore them in a script
I have this HTML script which displays some text on a webpage, with a button that allows you to copy the text to your clipboard:
<pre style="color: #000; background: #cccccc; padding:10px; ...
0
votes
1
answer
59
views
How to extract multiline content from the <pre> tag in html using Selenium
Originally the element looks like this:
<pre>test_line1 test_line2 test_line3 test4</pre>
but when i double click it it looks like this:
<pre>test_line1
test_line2
...
0
votes
1
answer
319
views
Table cell is not respecting CSS width value [duplicate]
I was just going through this Github doc when I noticed the table was hard to read and started poking around the CSS to make it more eye appealing.
However, I realised that the td elements in the ...