배우기
엔진 클래스
UITableLayout

*이 콘텐츠는 AI(베타)를 사용해 번역되었으며, 오류가 있을 수 있습니다. 이 페이지를 영어로 보려면 여기를 클릭하세요.


코드 샘플
UI 테이블 만들기
local frame = script.Parent
-- 테이블 데이터
local headerWidth = { 200, 80, 80 }
local headers = {
"이름",
"직업",
"현금",
}
local data = {
{ "밥", "웨이터", 100 },
{ "리사", "경찰", 200 },
{ "조지", "-", 50 },
}
-- 먼저, 테이블 레이아웃을 만듭니다
local uiTableLayout = Instance.new("UITableLayout")
uiTableLayout.FillDirection = Enum.FillDirection.Vertical
uiTableLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
uiTableLayout.VerticalAlignment = Enum.VerticalAlignment.Center
uiTableLayout.FillEmptySpaceColumns = false
uiTableLayout.FillEmptySpaceRows = false
uiTableLayout.Padding = UDim2.new(0, 5, 0, 5)
uiTableLayout.SortOrder = Enum.SortOrder.LayoutOrder
frame.Size = UDim2.new(0, 0, 0, 40) -- 부모 프레임의 크기가 셀 크기입니다
uiTableLayout.Parent = frame
-- 다음으로, 열 헤더를 생성합니다
local headerFrame = Instance.new("Frame")
headerFrame.Name = "헤더들"
headerFrame.Parent = frame
for i = 1, #headers do
local headerText = headers[i]
local headerCell = Instance.new("TextLabel")
headerCell.Text = headerText
headerCell.Name = headerText
headerCell.LayoutOrder = i
headerCell.Size = UDim2.new(0, 0, 0, 24)
headerCell.Parent = headerFrame
local headerSize = Instance.new("UISizeConstraint")
headerSize.MinSize = Vector2.new(headerWidth[i], 0)
headerSize.Parent = headerCell
end
-- 마지막으로, 각 행과 그 행의 열을 반복하여 데이터 행을 추가합니다
for index, value in ipairs(data) do
local rowData = value
local rowFrame = Instance.new("Frame")
rowFrame.Name = "Row" .. index
rowFrame.Parent = frame
for col = 1, #value do
local cellData = rowData[col]
local cell = Instance.new("TextLabel")
cell.Text = cellData
cell.Name = headers[col]
cell.TextXAlignment = Enum.TextXAlignment.Left
if tonumber(cellData) then -- 이 셀이 숫자라면 오른쪽으로 정렬합니다
cell.TextXAlignment = Enum.TextXAlignment.Right
end
cell.ClipsDescendants = true
cell.Size = UDim2.new(0, 0, 0, 24)
cell.Parent = rowFrame
end
end

API 참조
속성
FillEmptySpaceColumns
병렬 읽기
기능: UI
UITableLayout.FillEmptySpaceColumns:boolean
코드 샘플
UI 테이블 만들기
local frame = script.Parent
-- 테이블 데이터
local headerWidth = { 200, 80, 80 }
local headers = {
"이름",
"직업",
"현금",
}
local data = {
{ "밥", "웨이터", 100 },
{ "리사", "경찰", 200 },
{ "조지", "-", 50 },
}
-- 먼저, 테이블 레이아웃을 만듭니다
local uiTableLayout = Instance.new("UITableLayout")
uiTableLayout.FillDirection = Enum.FillDirection.Vertical
uiTableLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
uiTableLayout.VerticalAlignment = Enum.VerticalAlignment.Center
uiTableLayout.FillEmptySpaceColumns = false
uiTableLayout.FillEmptySpaceRows = false
uiTableLayout.Padding = UDim2.new(0, 5, 0, 5)
uiTableLayout.SortOrder = Enum.SortOrder.LayoutOrder
frame.Size = UDim2.new(0, 0, 0, 40) -- 부모 프레임의 크기가 셀 크기입니다
uiTableLayout.Parent = frame
-- 다음으로, 열 헤더를 생성합니다
local headerFrame = Instance.new("Frame")
headerFrame.Name = "헤더들"
headerFrame.Parent = frame
for i = 1, #headers do
local headerText = headers[i]
local headerCell = Instance.new("TextLabel")
headerCell.Text = headerText
headerCell.Name = headerText
headerCell.LayoutOrder = i
headerCell.Size = UDim2.new(0, 0, 0, 24)
headerCell.Parent = headerFrame
local headerSize = Instance.new("UISizeConstraint")
headerSize.MinSize = Vector2.new(headerWidth[i], 0)
headerSize.Parent = headerCell
end
-- 마지막으로, 각 행과 그 행의 열을 반복하여 데이터 행을 추가합니다
for index, value in ipairs(data) do
local rowData = value
local rowFrame = Instance.new("Frame")
rowFrame.Name = "Row" .. index
rowFrame.Parent = frame
for col = 1, #value do
local cellData = rowData[col]
local cell = Instance.new("TextLabel")
cell.Text = cellData
cell.Name = headers[col]
cell.TextXAlignment = Enum.TextXAlignment.Left
if tonumber(cellData) then -- 이 셀이 숫자라면 오른쪽으로 정렬합니다
cell.TextXAlignment = Enum.TextXAlignment.Right
end
cell.ClipsDescendants = true
cell.Size = UDim2.new(0, 0, 0, 24)
cell.Parent = rowFrame
end
end

FillEmptySpaceRows
병렬 읽기
기능: UI
UITableLayout.FillEmptySpaceRows:boolean
코드 샘플
UI 테이블 만들기
local frame = script.Parent
-- 테이블 데이터
local headerWidth = { 200, 80, 80 }
local headers = {
"이름",
"직업",
"현금",
}
local data = {
{ "밥", "웨이터", 100 },
{ "리사", "경찰", 200 },
{ "조지", "-", 50 },
}
-- 먼저, 테이블 레이아웃을 만듭니다
local uiTableLayout = Instance.new("UITableLayout")
uiTableLayout.FillDirection = Enum.FillDirection.Vertical
uiTableLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
uiTableLayout.VerticalAlignment = Enum.VerticalAlignment.Center
uiTableLayout.FillEmptySpaceColumns = false
uiTableLayout.FillEmptySpaceRows = false
uiTableLayout.Padding = UDim2.new(0, 5, 0, 5)
uiTableLayout.SortOrder = Enum.SortOrder.LayoutOrder
frame.Size = UDim2.new(0, 0, 0, 40) -- 부모 프레임의 크기가 셀 크기입니다
uiTableLayout.Parent = frame
-- 다음으로, 열 헤더를 생성합니다
local headerFrame = Instance.new("Frame")
headerFrame.Name = "헤더들"
headerFrame.Parent = frame
for i = 1, #headers do
local headerText = headers[i]
local headerCell = Instance.new("TextLabel")
headerCell.Text = headerText
headerCell.Name = headerText
headerCell.LayoutOrder = i
headerCell.Size = UDim2.new(0, 0, 0, 24)
headerCell.Parent = headerFrame
local headerSize = Instance.new("UISizeConstraint")
headerSize.MinSize = Vector2.new(headerWidth[i], 0)
headerSize.Parent = headerCell
end
-- 마지막으로, 각 행과 그 행의 열을 반복하여 데이터 행을 추가합니다
for index, value in ipairs(data) do
local rowData = value
local rowFrame = Instance.new("Frame")
rowFrame.Name = "Row" .. index
rowFrame.Parent = frame
for col = 1, #value do
local cellData = rowData[col]
local cell = Instance.new("TextLabel")
cell.Text = cellData
cell.Name = headers[col]
cell.TextXAlignment = Enum.TextXAlignment.Left
if tonumber(cellData) then -- 이 셀이 숫자라면 오른쪽으로 정렬합니다
cell.TextXAlignment = Enum.TextXAlignment.Right
end
cell.ClipsDescendants = true
cell.Size = UDim2.new(0, 0, 0, 24)
cell.Parent = rowFrame
end
end

MajorAxis
병렬 읽기
기능: UI
UITableLayout.MajorAxis:Enum.TableMajorAxis
코드 샘플
UI 테이블 만들기
local frame = script.Parent
-- 테이블 데이터
local headerWidth = { 200, 80, 80 }
local headers = {
"이름",
"직업",
"현금",
}
local data = {
{ "밥", "웨이터", 100 },
{ "리사", "경찰", 200 },
{ "조지", "-", 50 },
}
-- 먼저, 테이블 레이아웃을 만듭니다
local uiTableLayout = Instance.new("UITableLayout")
uiTableLayout.FillDirection = Enum.FillDirection.Vertical
uiTableLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
uiTableLayout.VerticalAlignment = Enum.VerticalAlignment.Center
uiTableLayout.FillEmptySpaceColumns = false
uiTableLayout.FillEmptySpaceRows = false
uiTableLayout.Padding = UDim2.new(0, 5, 0, 5)
uiTableLayout.SortOrder = Enum.SortOrder.LayoutOrder
frame.Size = UDim2.new(0, 0, 0, 40) -- 부모 프레임의 크기가 셀 크기입니다
uiTableLayout.Parent = frame
-- 다음으로, 열 헤더를 생성합니다
local headerFrame = Instance.new("Frame")
headerFrame.Name = "헤더들"
headerFrame.Parent = frame
for i = 1, #headers do
local headerText = headers[i]
local headerCell = Instance.new("TextLabel")
headerCell.Text = headerText
headerCell.Name = headerText
headerCell.LayoutOrder = i
headerCell.Size = UDim2.new(0, 0, 0, 24)
headerCell.Parent = headerFrame
local headerSize = Instance.new("UISizeConstraint")
headerSize.MinSize = Vector2.new(headerWidth[i], 0)
headerSize.Parent = headerCell
end
-- 마지막으로, 각 행과 그 행의 열을 반복하여 데이터 행을 추가합니다
for index, value in ipairs(data) do
local rowData = value
local rowFrame = Instance.new("Frame")
rowFrame.Name = "Row" .. index
rowFrame.Parent = frame
for col = 1, #value do
local cellData = rowData[col]
local cell = Instance.new("TextLabel")
cell.Text = cellData
cell.Name = headers[col]
cell.TextXAlignment = Enum.TextXAlignment.Left
if tonumber(cellData) then -- 이 셀이 숫자라면 오른쪽으로 정렬합니다
cell.TextXAlignment = Enum.TextXAlignment.Right
end
cell.ClipsDescendants = true
cell.Size = UDim2.new(0, 0, 0, 24)
cell.Parent = rowFrame
end
end

Padding
병렬 읽기
기능: UI
UITableLayout.Padding:UDim2
코드 샘플
UI 테이블 만들기
local frame = script.Parent
-- 테이블 데이터
local headerWidth = { 200, 80, 80 }
local headers = {
"이름",
"직업",
"현금",
}
local data = {
{ "밥", "웨이터", 100 },
{ "리사", "경찰", 200 },
{ "조지", "-", 50 },
}
-- 먼저, 테이블 레이아웃을 만듭니다
local uiTableLayout = Instance.new("UITableLayout")
uiTableLayout.FillDirection = Enum.FillDirection.Vertical
uiTableLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
uiTableLayout.VerticalAlignment = Enum.VerticalAlignment.Center
uiTableLayout.FillEmptySpaceColumns = false
uiTableLayout.FillEmptySpaceRows = false
uiTableLayout.Padding = UDim2.new(0, 5, 0, 5)
uiTableLayout.SortOrder = Enum.SortOrder.LayoutOrder
frame.Size = UDim2.new(0, 0, 0, 40) -- 부모 프레임의 크기가 셀 크기입니다
uiTableLayout.Parent = frame
-- 다음으로, 열 헤더를 생성합니다
local headerFrame = Instance.new("Frame")
headerFrame.Name = "헤더들"
headerFrame.Parent = frame
for i = 1, #headers do
local headerText = headers[i]
local headerCell = Instance.new("TextLabel")
headerCell.Text = headerText
headerCell.Name = headerText
headerCell.LayoutOrder = i
headerCell.Size = UDim2.new(0, 0, 0, 24)
headerCell.Parent = headerFrame
local headerSize = Instance.new("UISizeConstraint")
headerSize.MinSize = Vector2.new(headerWidth[i], 0)
headerSize.Parent = headerCell
end
-- 마지막으로, 각 행과 그 행의 열을 반복하여 데이터 행을 추가합니다
for index, value in ipairs(data) do
local rowData = value
local rowFrame = Instance.new("Frame")
rowFrame.Name = "Row" .. index
rowFrame.Parent = frame
for col = 1, #value do
local cellData = rowData[col]
local cell = Instance.new("TextLabel")
cell.Text = cellData
cell.Name = headers[col]
cell.TextXAlignment = Enum.TextXAlignment.Left
if tonumber(cellData) then -- 이 셀이 숫자라면 오른쪽으로 정렬합니다
cell.TextXAlignment = Enum.TextXAlignment.Right
end
cell.ClipsDescendants = true
cell.Size = UDim2.new(0, 0, 0, 24)
cell.Parent = rowFrame
end
end

©2026 Roblox Corporation. Roblox 및 Roblox 로고, 'Powering Imagination'은 미국 및 기타 국가 내 당사의 등록 및 미등록 상표입니다.